package com.huang.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 黄自祥
 * @date 2022/05/03 13:39
 * @Description:
 */
@Getter
public enum SexEnum {
    /**
     * 男
     */
    MAN("1","男"),
    /**
     * 女
     */
    WOMAN("2","女");

    /**
     * 数据库字段
     */
    @EnumValue
    private final String  sex;
    /**
     * 映射成结果
     */
    @JsonValue
    private final String value;

    @JsonCreator
    SexEnum(String sex, String value) {
        this.sex = sex;
        this.value = value;
    }

    @Override
    public String toString() {
        return  value;
    }
}
